{include file="common/head"/}
<div class="admin-main layui-anim layui-anim-upbit" ng-app="hd" ng-controller="ctrl">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>{$title}</legend>
    </fieldset>
    <form class="layui-form layui-form-pane">
        <div class="layui-form-item">
            <label class="layui-form-label">会员组名称</label>
            <div class="layui-input-4">
                <input type="text" name="level_name" ng-model="field.level_name" lay-verify="required" placeholder="输入会员组名称" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">投资金额</label>
                <div class="layui-input-inline" >
                    <input type="text" name="lsk" ng-model="field.lsk" placeholder="请输入投资金额" class="layui-input">
                </div>

            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">A网见点</label>
                <div class="layui-input-inline" >
                    <input type="text" name="b1" ng-model="field.b1" placeholder="请输入A网见点" class="layui-input">
                </div>

            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">B网首层见点</label>
                <div class="layui-input-inline" >
                    <input type="text" name="b2" ng-model="field.b2" placeholder="请输入A网见点" class="layui-input">
                </div>

            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">B网见点</label>
                <div class="layui-input-inline" >
                    <input type="text" name="b3" ng-model="field.b3" placeholder="请输入A网见点" class="layui-input">
                </div>

            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">手续费</label>
                <div class="layui-input-inline" >
                    <input type="text" name="b4" ng-model="field.b4" placeholder="请输入A网见点" class="layui-input">
                </div>

            </div>
        </div>
 <!--       <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">利润</label>
                <div class="layui-input-inline" >
                    <input type="text" name="lirun" ng-model="field.lirun" placeholder="请输入利润" class="layui-input">
                </div>

            </div>
        </div>-->
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">报单奖</label>
                <div class="layui-input-inline" >
                    <input type="text" name="baodan" ng-model="field.baodan" placeholder="请输入报单奖" class="layui-input">
                </div>

            </div>
        </div>
        <!--       <div class="layui-form-item">
                   <div class="layui-inline">
                       <label class="layui-form-label">分红奖</label>
                       <div class="layui-input-inline" >
                           <input type="text" name="fenhong" ng-model="field.fenhong" placeholder="请输入分红奖" class="layui-input">
                       </div>

                   </div>
               </div>
               <div class="layui-form-item">
                   <div class="layui-inline">
                       <label class="layui-form-label">培育奖</label>
                       <div class="layui-input-inline" >
                           <input type="text" name="b1" ng-model="field.b1" placeholder="请输入培育奖" class="layui-input">
                       </div>

                   </div>
               </div>-->
 <!--       <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">A网跳网条件</label>
                <div class="layui-input-inline" >
                    <input type="text" name="bomlimit" ng-model="field.bomlimit" placeholder="输入需要的满足条件" class="layui-input">
                </div>

            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">B网跳网条件</label>
                <div class="layui-input-inline" >
                    <input type="text" name="achievement" ng-model="field.achievement" placeholder="输入需要的满足条件" class="layui-input">
                </div>

            </div>
        </div>-->
        <div class="layui-form-item">
            <label class="layui-form-label">{:lang('order')}</label>
            <div class="layui-input-4">
                <input type="text" name="sort" ng-model="field.sort" placeholder="从小到大排序" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">
                从小到大排序
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="button" class="layui-btn" lay-submit="" lay-filter="submit">{:lang('submit')}</button>
                <a href="{:url('userGroup')}" class="layui-btn layui-btn-primary">{:lang('back')}</a>
            </div>
        </div>
    </form>
</div>
{include file="common/foot"/}
<script src="/static/common/js/angular.min.js"></script>
<script>
    var m = angular.module('hd',[]);
    m.controller('ctrl',['$scope',function($scope) {
        $scope.field = '{$info|raw}'!='null'?{$info|raw}:{level_id:'',level_name:'',bomlimit:'',toplimit:'',sort:50};
        layui.use(['form', 'layer'], function () {
            var form = layui.form, $ = layui.jquery;
            form.on('submit(submit)', function (data) {
                // 提交到方法 默认为本身
                var loading = layer.load(1, {shade: [0.1, '#fff']});
                data.field.level_id = $scope.field.level_id;
                $.post("", data.field, function (res) {
                    layer.close(loading);
                    if (res.code > 0) {
                        layer.msg(res.msg, {time: 1800, icon: 1}, function () {
                            location.href = res.url;
                        });
                    } else {
                        layer.msg(res.msg, {time: 1800, icon: 2});
                    }
                });
            })
        });
    }]);
</script>